import  pymysql
mysql_info={
    "host":"118.24.3.40",
    "user":"jxz",
    "password":"123456",
    "db":"jxz",
    "charset":"utf8",
    "autocommit":True
}

def execute_sql(sql,more=True,db_info=None):
    if db_info:
        conn=pymysql.connect(**db_info)
    else:
        conn=pymysql.connect(**mysql_info)
    cursor=conn.cursor(pymysql.cursors.DictCursor)
    cursor.execute(sql)
    if more:
        result=cursor.fetchall()
    else:
        result=cursor.fetchone()
    cursor.close()
    conn.close()
    return result

# if __name__=="__main__":


